package com.example.tests;

import java.util.Set;
import java.util.logging.Logger;

import org.testng.annotations.Test;

public class ContactCreationTests extends TestBase {
		
	private Logger log = Logger.getLogger("contactCreatonTests");
	
	@Test(dataProvider = "contactsFromFile", dataProviderClass = ContactDataGenerator.class)
	public void testValidContactCanBeCreated(ContactObject validContact) throws Exception {
		log.info("testValidContactCanBeCreated start");
		
		Set<ContactObject> oldList = app.getContactHelper().getContacts();
		log.info("oldList=" + oldList);
		
		app.getContactHelper().createContact(validContact);
		
		Set<ContactObject> newList = app.getContactHelper().getContacts();
		log.info("newList=" + newList);
		
		verifyContactAdded (oldList, validContact, newList);
		log.info("testValidContactCanBeCreated end");
	}
}
